package com.heima.admin.feign;

import com.heima.admin.mapper.AdUserMapper;
import com.heima.client.admin.IAdminClient;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.common.enums.AppHttpCodeEnum;
import com.heima.model.common.pojos.admin.AdUser;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 远程保存AdUser
 */
@RestController
public class AdminFeign implements IAdminClient {
    @Autowired
    private AdUserMapper userMapper;
    @PostMapping("login/admin/save/aduser")
    public ResponseResult saveAdUser(@RequestBody AdUser adUser) {
        userMapper.insert(adUser);
        return ResponseResult.okResult(AppHttpCodeEnum.SUCCESS);
    }
}
